<?php
/////////////////////////////////////////////////////////////////////////////////////		
include "required_code.php"; 

	session_start();
	$ses_user_id =$_SESSION['ses_user_id'];
	$ses_std_id = $_SESSION['ses_std_id'];
	$_SESSION['concept']=$_GET["c"];
	$concept=$_SESSION['concept'];

	if($ses_user_id <> session_id() or  $ses_std_id ==''){
		echo "Authentication failed";
		echo "<meta http-equiv='refresh' content='2;URL=index.php' />";
		}    
						/*	$query2="SELECT * FROM std_progress WHERE std_id=$ses_std_id";
							$db_result2=db_query($query2);
							$result2=mysql_fetch_array($db_result2);
							//echo $result2['ls_sts'];
							//echo $result2['pretest_sts'];
								if($result2['ls_sts']==1){
								echo "Redirecting";
								echo "<meta http-equiv='refresh' content='1;URL=progress.php' />";
							}*/
							else { 
							
								$round="";
								$query2="SELECT * FROM fa_test_progress WHERE std_id=$ses_std_id AND concept=$concept";
								 $db_result2=db_query($query2);
								 $result2=mysql_fetch_array($db_result2);
								 if($result2['fa1']==""){
									 $round=1;
								 }
								 else if($result2['fa1']=="F"){
									 $round=2;
								 }
								 else if($result2['fa1']=="P"){
									 $round="1";
								 }	
								 echo $_SESSION['round']=$round;
								 
								 $query3="SELECT * FROM std_ls_status WHERE std_id=$ses_std_id";
								 $db_result3=db_query($query3);
								 $result3=mysql_fetch_array($db_result3);
								 $_SESSION['ls']=$result3['std_ls'];
								 
								 echo "Redirecting";
								 echo "<meta http-equiv='refresh' content='1;URL=concept_progress.php' />";


									
/////////////////////////////////////////////////////////////////////////////////////	


/////////////////////////////////////////////////////////////////////////////////////		
		$db_close=db_disconnect($db_open);
		}
/////////////////////////////////////////////////////////////////////////////////////		
?>